<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
 <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
  <%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %><h1>Welcome to the Carbon Counter Website</h1>
	<h3>We help individuals and organizations manage their environmental footprint</h3>
	<%if(session.getAttribute("Customer") == null){ %>	
	<h4>The only way to stop global warming is to slow our carbon output.  Does this mean you can't use any device that puts out carbon dioxide?  Obviously that wouldn't be much of a life.  However you could find ways of reducing your impact by finding out what your biggest carbon outputs are, and what you can do to reduce them.  Did you know a flight from Boston to New York generates on average 70kg CO2 per passenger (carbonfund.org)? Calculate your CO2 usage using the calculator below: </h4>
	<h2>Carbon Calculator</h2>
	<div id="calc">
		<display:table name="indexForm.lookupList" class="mars" id="row" >
		    <display:column property="description" title="Carbon Source" />
		    <display:column property="units"  title="Unit" />
		    <display:column title="Quantity"   >
		    	<input type="text" id="quan${row_rowNum}" class="quant" maxlength="10"/>
		    </display:column>
		    <display:column title="Carbon Price">
		    	$&nbsp;<input type="text" class="price" value='<fmt:formatNumber pattern="###,###.##" value="${row.carbonCost}"/>' disabled="disabled"/>
		    </display:column>
		    <display:column title="Total" >
		    	<input type="text" id="total${row_rowNum}" class="total" maxlength="10" disabled="disabled"/>
		    </display:column>
	  	</display:table>
	  	<br/>
	  	<div id="totalLabel">
	  		<label>Overall:</label>&nbsp;$&nbsp;<input type="text" id="totalAmt" value="0" disabled="disabled"/>
	  	</div>
	  	<br/>
	  	<button id="calculateBtn">Calculate</button>
	</div>
<%} else{ %>
<h4>Check out your carbon account using the link above or calculate your CO2 usage using the calculator below.  
In the calculator below, once you have entered your current and forecast carbon output, click on submit to add 
these values to your account. </h4>
	<h2>Carbon Calculator</h2>
	
<html:form action="/welcome.do?do=submit" method="post">
	<div id="calc">
		<display:table name="indexForm.lookupList" class="mars" id="row" >
		    <display:column property="description" title="Carbon Source" />
		    <display:column property="units"  title="Unit" />
		    <display:column title="Quantity"   >
		    	<input type="text" id="quan${row_rowNum}" class="quant" maxlength="10"/>
		    </display:column>
		    <display:column title="Carbon Price">
		    	$&nbsp;<input type="text" class="price" value='<fmt:formatNumber pattern="###,###.##" value="${row.carbonCost}"/>' disabled="disabled"/>
		    </display:column>
		    <display:column title="Total" >
		    	<input type="text" id="total${row_rowNum}" class="total" maxlength="10" disabled="disabled"/>
		    </display:column>
	  	</display:table>
	  	<br/>
	  	<div id="totalLabel">
	  		<label>Overall:</label>&nbsp;$&nbsp;<html:text property="carbonAmt" styleId="totalAmt" value="0" disabled="disabled"/>
	  	</div>
	  	<br/>
	  	<button id="calculateBtn">Calculate</button>
	  	<html:submit value="Save"></html:submit>
	</div>
</html:form>
<%} %>

	<TABLE border="1" cellpadding="2" cellspacing="1" ALIGN="right" width="36%">
	<TR>
	<TH>
		<h2>RSS News Feed</h2>
	</TH>

	</TR>
	<TR>
	<TD>

	<div align="right" width="50px" style="font-size:14px">
	<script language='Javascript' 
		src='http://www.rss2java.com/feed.php?number=4&date=1&desc=2&html=2&new=1&url=http%3A%2F%2Fwww.endscarbonoffsets.com%2Ffeeds%2Fnews.xml'
		frameborder="0" marginwidth="0" marginheight="0" scrolling="yes">
	</script>
	<noscript>
		<a href='http://www.rss2java.com/' target=_blank>RSS2JAVA</a>
	</noscript>

	</div>
	</TD>
	</TR>
	</TABLE>
<div id="content2">
		<h2>Carbon Offset & Environment Links</h2>
	<ul>
		<li><a title="Carbon Fund" href="http://www.carbonfund.org">The Carbon Fund</a></li>
		<li><a title="Carbon Offsets Daily" href="http://www.carbonoffsetsdaily.com/">Carbon Offsets</a></li>
		<li><a title="Carbon Neutral Website" href="http://www.carbon-neutral-website.org/">Carbon Neutral Website</a></li>
		<li><a title="Carbon Offsets Wikipedia" href="http://en.wikipedia.org/wiki/Carbon_offset">Carbon Offsets in Wikipedia</a></li>
		<li><a title="Carbon Offset Research" href="http://www.co2offsetresearch.org/index.html">Carbon Offset Research & Education</a></li>
	</ul>
</div>